package experiment.e03.code;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/9/29 15:55
 * @package experiment.e03.code
 * @description 文件说明
 */

public class E04_PerfectNumber {

    public static void main(String[] args) {
        int num = 28;

        // 求因子和
        int sum = 0;
        for (int i = 1; i < num; i++) {
            if (num % i == 0){
                sum += i;
            }
        }

        // 判断因子和 与 原数是否相等
        System.out.println(num == sum);
    }
}
